import { request } from "@/utils/service"
import type * as orderDown from "./types/orderDown"
import { getToken } from "@/utils/cache/cookies"
import axios from "axios"
const baseURL = import.meta.env.VITE_BASE_API

/** 查 */
export function getOrderDownDataApi(params: orderDown.IGetOrderDownRequestData) {
  return request<orderDown.ICreateOrderDownRequestData>({
    url: "excel/query",
    method: "get",
    params
  })
}
/**删除 */
export function delOrderDownDataApi(excel_id: any) {
  return request({
    url: "excel/del",
    method: "delete",
    params: {
      excel_id
    }
  })
}

//下载
export function downOrderList(data: any) {
  return axios({
    url: `${baseURL}/excel/downExcel`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data,
    responseType: "blob"
  })
}
